//
//  YBEarnDetailRow.m
//  Nectar
//
//  Created by famer on 2023/11/10.
//  Copyright © 2023 asance. All rights reserved.
//

#import "YBEarnDetailRow.h"

@implementation YBEarnDetailRow

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        
        [self addSubview:self.titleLabel];
        [self addSubview:self.valueLabel];
        [self addSubview:self.lineView];
    }
    return self;
}


- (void)layoutSubviews{
    [super layoutSubviews];
    
    CGFloat width = self.frame.size.width;
    CGFloat height = self.frame.size.height;
    CGFloat leftMargin = 12;
    CGFloat topMargin = 16;
    
    ///
    self.titleLabel.frame = CGRectMake(0,
                                       0,
                                       width,
                                       height);
        
    self.valueLabel.frame = CGRectMake(0,
                                       0,
                                       width,
                                       height);
    
    self.lineView.frame = CGRectMake(0, self.height-1, width, 1);
}

#pragma mark - Getter Setter
YBViewGetter(lineView, _lineView, [UIColor hexColor:@"F6F5F6"]);

YBLabelGetter(titleLabel, _titleLabel, [UIFont systemFontOfSize:12], @"Title", [UIColor hexColor:@"84828C"], NSTextAlignmentLeft);
YBLabelGetter(valueLabel, _valueLabel, [UIFont systemFontOfSize:14], @"*", kThemeBlackColor, NSTextAlignmentRight);

@end
